from os import listdir
from os.path import join

if __name__ == '__main__':
    path = "../doc"
    counts = 0
    contents = listdir(path=path)
    for content in contents:
        # print(content)

        if content.endswith(".txt"):
            print(content)

            with open(file=join(path, content), mode="r", encoding="utf-8") as f:
                text = f.readline()
                while( text):
                    # print(text, end="")
                    counts = counts + 1
                    text = f.readline()

        else:
            pass

    print(counts)